<#import "commons.ftl" as m/>

package <@m.getBasePackage param=context flag=true/><@m.getServicePackage param=context flag=false/>;

import <@m.getBasePackage param=context flag=true/><@m.getModelPackage param=context flag=true/>${table.upperName}<@m.getModelSuffix param=context/>;
import <@m.getBasePackage param=context flag=true/><@m.getQueryPackage param=context flag=true/>${table.upperName}<@m.getQuerySuffix param=context/>;

import java.util.List;

/**
 * <pre>
 * ${(table.comment)!''}业务代码,流程控制和业务流程主要还是在Api上写.
 * </pre>
 *
 * @author ${context.conf.author!'系统生成'}
 * @email ${context.conf.email!'系统生成'}
 * @version ${context.conf.version!'1.0.0'}
 * @date ${.now?string('yyyy-MM-dd')}
 * @copyright ${context.conf.copyright!'系统生成'}
 */
public interface <@m.getServicePrefix param=context/>${table.upperName}<@m.getServiceSuffix param=context/> {
    /**
     * <pre>
     * 分页查询${(table.comment)!''}数据
     * </pre>
     *
     * @param query 查询条件,继承分页信息
     * @return ${(table.comment)!''}数据集合
     */
    List<${table.upperName}<@m.getModelSuffix param=context/>> queryPage(${table.upperName}<@m.getQuerySuffix param=context/> query);

    /**
     * <pre>
     * 根据ID查询${(table.comment)!'Long'}数据
     * </pre>
     *
     * @param ${table.lowerName}Id ${(table.comment)!''}Id
     * @return ${(table.comment)!'Long'}
     */
    ${table.upperName}<@m.getModelSuffix param=context/> queryById(${table.pkType!'Long'} ${table.lowerName}Id);

    /**
     * <pre>
     * 保存信息
     * </pre>
     *
     * @param ${table.lowerName} ${(table.comment)!'Long'}
     * @return 保存数据ID
     */
    ${table.pkType!'Long'} insert${table.upperName}(${table.upperName}<@m.getModelSuffix param=context/> ${table.lowerName});

    /**
     * <pre>
     * 根据ID更新信息
     * </pre>
     *
     * @param ${table.lowerName} ${(table.comment)!'Long'}
     * @return 更新数量
     */
    int update${table.upperName}(${table.upperName}<@m.getModelSuffix param=context/> ${table.lowerName});

    /**
     * <pre>
     * 根据ID删除信息
     * </pre>
     *
     * @param ${table.lowerName}Id ${(table.comment)!'Long'}Id
     * @return 删除数量
     */
    int deleteById(${table.pkType!'Long'} ${table.lowerName}Id);

}
